<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" th:with="title='精品书城',active='home'"
      xmlns="http://www.w3.org/1999/html">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>添加商品</title>
    <link rel="stylesheet" type="text/css" href="http://localhost:8894/css/reset.css">
    <link rel="stylesheet" type="text/css" href="http://localhost:8894/css/main.css">
    <script type="text/javascript" src="http://localhost:8894/js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="http://localhost:8894/js/jquery-ui.min.js"></script>
    <script type="text/javascript" src="http://localhost:8894/js/slide.js"></script>
    <script src="http://localhost:8894/js/index.js"></script>
    <style type="text/css">
        .add{
            margin-top: 30px;
            background-color: #E6E4E4;
        }
        .addform{
            width: auto;
            height: auto;
            text-align: center;
        }
        .addp{
            margin-top: 30px;
        }
    </style>
</head>
<body>

<div class="header_con">
    <div class="header">
        <div class="welcome fl">欢迎来到精品书城!</div>
        <div class="fr">
            <div class="login_btn fl" th:if="${session.uaccount} ne null">
                <a href="">
                    欢迎您：<em th:text="${session.uaccount}"></em>
                </a>
                <span>|</span>
                <a th:href="@{'getAll?uaccount='+${session.uaccount}}">首页</a>
                <span>|</span>
                <a href="http://localhost:8896/goods/quit">退出</a>

            </div>
            <div class="login_btn fl" th:if="${session.uaccount} eq null">
                <a href="http://localhost:8893/admin/tologin">
                    请您登陆
                </a>
            </div>
        </div>
    </div>
</div>

<div class="search_bar clearfix">
    <a th:href="@{'getAll?uaccount='+${session.uaccount}}" class="logo fl"><img src="http://localhost:8894/img/shucheng.jpg"></a>
    <div class="search_con fl">
        <form action="/goods/mgetOne" method="get">
            <input type="text" class="input_text fl" name="name" placeholder="搜索商品">
            <input type="submit" class="input_btn fr" name="" value="搜索">
        </form>
    </div>
    <!--<div class="guest_cart fr">-->
    <!--<a href="cart.html" class="cart_name fl">我的购物车</a>-->
    <!--<div class="goods_count fl" id="show_count">1</div>-->
    <!--</div>-->
</div>
<div class="add" action="/goods/addgoods" method="get">
    <form class="addform" action="addgoods">
        <p class="addp">商品名称:<input type="text" name="gname"></p>
        <p class="addp">&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;图片信息:
            <input type="file" name="gpicture"  accept="image/*"></p>
        <p class="addp">商品介绍:<input type="text" name="gdetails"></p>
        <p class="addp">商品价格:<input type="number" name="gprice"></p>
        <P class="addp">商品类型:<input type="radio" name="types" value="0">悬疑推理
            <input type="radio" name="types" value="1">国风文化
            <input type="radio" name="types" value="2">兴趣培养
            <input type="radio" name="types" value="3">经典名著
        </P>
        <P class="addp"> <input  type="submit" value="提交" style="width:80px;height:35px;text-align:center;background: #ff3e3e;color: whitesmoke;font-family: Microsoft Yahei" >
            <input  type="reset" value="重置" style="width:80px;height:35px;text-align:center;background: #ff3e3e;color: whitesmoke;font-family: Microsoft Yahei" ></P>

    </form>

</div>




    <div class="footer">
        <div class="foot_link">
            <a href="#">关于我们</a>
            <span>|</span>
            <a href="#">联系我们</a>
            <span>|</span>
            <a href="#">招聘人才</a>
            <span>|</span>
            <a href="#">友情链接</a>
        </div>
        <p>CopyRight © 2021 人生无限公司 All Rights Reserved</p>
        <p>电话：88888888    河南省洛阳市洛阳理工学院开元校区</p>
    </div>
    <div class="add_jump"></div>


    <script src="http://localhost:8894/js/jquery-2.1.1.min.js"></script>
    <script type="text/javascript">
        /*<![CDATA[*/
        $(document).on('click', '#sendArr', function () {
            var name = ($("#name").html());
            var price=($("#price").html());
            alert(name+""+price);
            $.ajax({
                type: 'get',
                dataType: 'json',
                url: 'http://localhost:8894/goods/cart',
                data: {
                    name:name,
                    price:price,
                },
            });
        });
    </script>
</form>
</body>
</html>
